package com.hblack.manage.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.hblack.common.bean.EasyUIResult;
import com.hblack.manage.mapper.ItemParamMapper;
import com.hblack.manage.pojo.ItemParam;

@Service
public class ItemParamService extends BaseService<ItemParam> {
	
	@Autowired
	private ItemParamMapper itemParamMapper;

	public EasyUIResult queryListByPage(Integer pageNum, Integer pageSize) {
		
		PageHelper.startPage(pageNum, pageSize);
		
		List<ItemParam> list = itemParamMapper.select(null);
		
		if(list == null || list.size() == 0) {
			return null;
		} else {
			PageInfo<ItemParam> pageInfo = new PageInfo<>(list);
			
			return new EasyUIResult(pageInfo.getTotal(), list);
			
		}
	}


}
